package com.rui.patterns.factory.factoryMethod;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : CoffeeStore
 * @createTime : [2022/2/19 21:38]
 * @description : [描述该类的功能]
 */

public class CoffeeStore {

    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    /**
     * 点咖啡功能
     * @return Coffee
     */
    public Coffee orderCoffee(){
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
